<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <ul id="Li">
        <li>1</li>
        <li>2</li>
        <li>3</li>
    </ul>

    <script>
        var aLi = document.querySelectorAll('li');
        console.log(aLi);
        // 1、for循环
        // var arr = [];
        // for (let index = 0; index < aLi.length; index++) {
        //     const element = aLi[index];
        //     arr.push(element);
        // }
        // 2、slice方法
        // var arr = [].slice.call(aLi);
        // var arr = Array.prototype.slice.call(aLi);
        // 3、ES6的 ...扩展运算符
        // var arr = [...aLi];
        // 4、Array.from方法
        // var arr = Array.from(aLi);
        aLi.__proto__ = Array.prototype;
        console.log(aLi);
    </script>
</body>

</html>